package mnc.game.face;

import android.app.Activity;
import android.graphics.Point;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;
import bayaba.engine.lib.GameInfo;

public class Jewel extends Activity
{
	private GLView play;
	private GameMain sImg;
	public GameInfo gInfo;
	private View ad;
	
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        getWindow().addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setVolumeControlStream( AudioManager.STREAM_MUSIC );
        
        gInfo = new GameInfo( 480, 800 );
        
        Display display = getWindowManager().getDefaultDisplay(); 
        Point size = new Point();
//        display.getSize(size);
        
        gInfo.ScreenXsize = size.x; //super.getWindowManager().getDefaultDisplay().getWidth();
        gInfo.ScreenYsize = size.y; //super.getWindowManager().getDefaultDisplay().getHeight();
        gInfo.SetScale();
        
        sImg = new GameMain( this, gInfo );
        play = new GLView( this, sImg );
        play.setRenderer( new SurfaceClass(sImg) );
        
        //setContentView( play );

        LayoutInflater inflater = this.getLayoutInflater();
        FrameLayout frameLayout = new FrameLayout( this );
        setContentView( frameLayout );
        
        frameLayout.addView( play );
        ad = (View)inflater.inflate( R.layout.main, null );
        frameLayout.addView( ad );
    }
}